﻿using System;

    class MinAndMaxValue
    {
        static void Main()
        {
            Console.WriteLine("3. Returns the minimal and maximal numbers of sequence.\n");
            Console.Write("Sequence dimention :");
            int maxValue=0;
            int minValue=0;
            int dimention = int.Parse(Console.ReadLine());
            // I think the variable Input and variable check should be separated, but tonight I'm to lazy to do this
            //If the comment above is still there,  that means that I was too lazy all week long.
            for (int i = 0; i < dimention; i++)
            {
                int input = int.Parse(Console.ReadLine());
                if (i == 0)
                {
                    minValue = maxValue = input;
                }

                if (maxValue < input)
                {
                    maxValue = input;
                }

                if (minValue > input)
                {
                    minValue = input;
                }
            }
            Console.WriteLine("Maximal number is : {0}",maxValue);
            Console.WriteLine("Minimal number is : {0}", minValue);
        }
    }

